package com.util.vmwareops;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;

public class TestVMotionCronJob
{
    public static void main(String[] args) throws SchedulerException
    {
        Scheduler scheduler = new StdSchedulerFactory().getScheduler();
        JobKey jobKey = new JobKey("CronJobToTestVMotion ");
        JobDetail jobDetail = JobBuilder.newJob(CronJobToTestVMotion.class).withIdentity(jobKey).build();
//        jobDetail.getJobDataMap().put("vm0",vmName);

        TriggerKey triggerKey = new TriggerKey("SchedulerVMware ");
        Trigger trigger = TriggerBuilder.newTrigger().withIdentity(triggerKey).withSchedule(
                SimpleScheduleBuilder.simpleSchedule().withIntervalInMinutes(20).repeatForever()
        ).build();

        scheduler.scheduleJob(jobDetail, trigger);
        scheduler.start();
    }
}
